﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using Xamarin.Forms;
using Xamarin.Forms.Xaml;

namespace AppBlank.Pages
{
    //[XamlCompilation(XamlCompilationOptions.Compile)]
    public partial class VideoView : IAnimatedView
    {
        Models.KuaiYinShiVideo ViewModel;
        public VideoView(Models.KuaiYinShiVideo  video)
        {
            InitializeComponent();
            BindingContext = this.ViewModel = video;
            videoPlayer.Source = video.videourl;
        }

        public void StartAnimation()
        {
        }

        private void TapGestureRecognizer_Tapped(object sender, EventArgs e)
        {
            if (videoPlayer.State == Octane.Xamarin.Forms.VideoPlayer.Constants.PlayerState.Playing)
            {
                videoPlayer.Pause();
            }
            else {
                videoPlayer.Play();
            }
        }
    }
}